<%@ page language="java" contentType="text/html; charset=utf-8"  pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<style type="text/css"> 
<!-- 

.nav_op { 
line-height: 24px; list-style-type: none; 
display: inline-block;
position: relative;
} 
.nav_op a { 
display: block; width: 80px; text-align:center; 
} 
.nav_op a:link { 
color:#666; text-decoration:none; 
} 
.nav_op a:visited { 
color:#666;text-decoration:none; 
} 
.nav_op a:hover { 
text-decoration:none;font-weight:bold; 
} 
.nav_op li { 
width: 80px; 
} 
.nav_op li a:hover{ 
background:#999; 
} 
.nav_op ul { 
line-height: 27px; list-style-type: none;text-align:left; 
top: 22px;
left: -999em; width: 180px; position: absolute; 
z-index: 2;
} 
.nav_op li {
display: block;
}
.nav_op li a:link { 
color:#666; text-decoration:none; 
} 
.nav_op li a:visited { 
color:#666;text-decoration:none; 
} 
.nav_op li a:hover { 
color:#F3F3F3;text-decoration:none;font-weight:normal; 
background:#C00; 
} 
 .sfhover .nav_op ul { 
 left: auto; 
} 
#content { 
clear: left; 
} 
--> 
</style> 
<script type=text/javascript><!--//--><![CDATA[//><!-- 
function menuFix() { 
	$(document.body).on('mouseenter', '.nav_op', function () {
		$(this).parent().addClass('sfhover');
	}).on('mouseleave', '.nav_op', function () {
		$(this).parent().removeClass('sfhover');
	})
	/**
	var sfEls = document.getElementById("nav").getElementsByTagName("li"); 
	for (var i=0; i<sfEls.length; i++) { 
		sfEls[i].onmouseover=function() { 
		this.className+=(this.className.length>0? " ": "") + "sfhover"; 
		} 
		sfEls[i].onMouseDown=function() { 
		this.className+=(this.className.length>0? " ": "") + "sfhover"; 
		} 
		sfEls[i].onMouseUp=function() { 
		this.className+=(this.className.length>0? " ": "") + "sfhover"; 
		} 
		sfEls[i].onmouseout=function() { 
		this.className=this.className.replace(new RegExp("( ?|^)sfhover\\b"), 
		""); 
		} 
	} 
	**/
} 
menuFix(); 
//--><!]]></script> 
<div id="page-content" class="page-content">
		<div class="panel panel-default oparePanel">
			<div class="panel-body">
				<div class="searchBox">
				<input type="text" id="searchStr" name="searchStr"  placeholder="按用户姓名搜索" class="input_search" />
				<input type="submit"  class="btn_search" onclick="user.search('searchStr');"/>
				</div>
		
				<div class="opare">
					<input type="button"  value="+" class="btn_add" onclick="menuUrl('user/view', 'user:add');" />
					<input type="button"  value="删 除" class="btn" onclick="user.delBatch();"/>
				
				</div>
		
			</div>
		</div>
		
		<div class="portlet-body">
			<div class="table-scrollable">
				<table class="table table-condensed flip-content">
					<thead class="flip-content">
						<tr>
							<th style="width: 20px;"><input type="checkbox" id="all" name="all" onclick="checkAll('id');"/></th>
							<th width="10%">用户姓名</th>
							<th width="10%">登录名</th>
							<th width="10%">状态</th>
							<th width="10%">查询次数</th>
							<th width="10%">办公电话</th>
							<th width="20%">创建时间</th>
							<th width="30%" class="text-center">操作</th>
						</tr>
					</thead>
					<tbody id="select_tbody">
					   <c:if test="${result.code eq 'SUCCESS' }">
					     <c:forEach items="${result.data.rows}" var ="row" varStatus="status">
						     <tr>
								<td style="width: 20px;" class=""><input type="checkbox" name="id" id="id" value="${row.id }" /></td>
								<td width="10%" class="">${row.userName }</td>
								<td width="10%" class="">${row.account }</td>
								<c:choose>  
								   <c:when test="${row.status eq '0'}"> 
								     <td width="10%" class="">待审批</td>
								   </c:when>  
								   <c:when test="${row.status eq '1'}"> 
								     <td width="10%" class="">正常</td>
								   </c:when>  
								   <c:when test="${row.status eq '2'}"> 
								     <td width="10%" class="">审批失败</td>
								   </c:when>  
								   <c:when test="${row.status eq '3'}"> 
								     <td width="10%" class="">锁定</td>
								   </c:when>  
								   <c:when test="${row.status eq '4'}"> 
								     <td width="10%" class="">停用</td>
								   </c:when> 
								   <c:when test="${row.status eq '5'}"> 
								     <td width="10%" class="">解锁待审批</td>
								   </c:when> 
								   <c:when test="${row.status eq '6'}"> 
								     <td width="10%" class="">恢复待审批</td>
								   </c:when> 
								   <c:when test="${row.status eq '7'}"> 
								     <td width="10%" class="">已删除</td>
								   </c:when> 
								   <c:otherwise>
								     <td width="10%" class="">待审批</td>
								   </c:otherwise>
								</c:choose> 
								<td width="10%" class="">${row.limitCount }</td>
								<td width="10%" class="">${row.officePhone }</td>
								<td width="20%" class=""><fmt:formatDate value="${row.createTime }" pattern="yyyy-MM-dd HH:mm:ss" /></td>
								
								<td width="30%" class="text-center">
								
									<!--  <a href="javascript:;" onclick="user.dele('${row.id}');" class="a-delet">删除</a> -->
								 <c:if test="${row.id ne userModel.userId  }">	
									 <c:choose>  
									   <c:when test="${row.status eq '1' }"> 
											<a href="javascript:void(0);" onclick="updateShow('user/view', 'user:modify','${row.id}');" class="a-modefiy">修改</a>
											<a href="javascript:viod(0);" onclick="detailShow('user/getUserDetail', '','${row.id}');" class="a-detial">详情</a>
													
											<div class="nav_op"><a href="javascript:void(0);">更多</a>
												<ul>
												    <li><a href="javascript:void(0);" onclick="user.userSign(1,'${row.id}');" class="a-delet">签名</a></li>
													<li><a href="javascript:void(0);" onclick="user.statusModify('${row.id}','7','${row.status}');" class="a-delet">删除</a></li>
													<li><a href="javascript:void(0);" onclick="user.statusModify('${row.id}','3','${row.status}');" class="a-delet">锁定</a></li>
													<li><a href="javascript:void(0);" onclick="user.statusModify('${row.id}','4','${row.status}');" class="a-delet">停用</a></li>
													<li><a href="javascript:void(0);" onclick="user.defaultPwd('${row.id}');" class="a-delet">缺省密码</a></li>
												</ul>
										    </div>	
									   </c:when>  
									   <c:when test="${row.status eq '2'}"> 
										   											
											<a href="javascript:void(0);" onclick="updateShow('user/view', 'user:modify','${row.id}');" class="a-modefiy">修改</a>
											<a href="javascript:viod(0);" onclick="detailShow('user/getUserDetail', '','${row.id}');" class="a-detial">详情</a>
												
											<div class="nav_op"><a href="javascript:void(0);">更多</a>
												<ul>
													<li><a href="javascript:void(0);"  class="a-delet">删除</a></li>
													<li><a href="javascript:void(0);"  class="a-delet">锁定</a></li>
													<li><a href="javascript:void(0);"  class="a-delet">停用</a></li>
													
												</ul>
										   </div>
									   </c:when>  
									   <c:when test="${row.status eq '3'}"> 
										    
										   											
											<a href="javascript:void(0);" class="a-delet disabled">修改</a>
											<a href="javascript:viod(0);" onclick="detailShow('user/getUserDetail', '','${row.id}');" class="a-detial">详情</a>
												
											<div class="nav_op"><a href="javascript:void(0);">更多</a>
												<ul>
													<li><a href="javascript:void(0);"  class="a-delet disabled">删除</a></li>
													<li><a href="javascript:void(0);" onclick="user.statusModify('${row.id}','5','${row.status}');" class="a-delet">解锁</a></li>
													<li><a href="javascript:void(0);"  class="a-delet disabled">停用</a></li>														
												</ul>
										    </div>
										    
									   </c:when>  
									   
									   <c:when test="${row.status eq '4'}"> 
									   
									        <a href="javascript:void(0);"  class="a-delet disabled">修改</a>
											<a href="javascript:viod(0);" onclick="detailShow('user/getUserDetail', '','${row.id}');" class="a-detial">详情</a>
												
											<div class="nav_op"><a href="javascript:void(0);">更多</a>
												<ul>
													<li><a href="javascript:void(0);"  class="a-delet">删除</a></li>
													<li><a href="javascript:void(0);" onclick="user.statusModify('${row.id}','6','${row.status}');" class="a-delet">恢复</a></li>
													<li><a href="javascript:void(0);"  class="a-delet">停用</a></li>
													
												</ul>
										   </div>								         
										   
									   </c:when> 
									   <c:when test="${row.status eq '7'}"> 
										    
										   											
											<a href="javascript:void(0);" class="a-delet disabled">修改</a>
											<a href="javascript:viod(0);" onclick="detailShow('user/getUserDetail', '','${row.id}');详情</a>
												
											<div class="nav_op"><a href="javascript:void(0);">更多</a>
												<ul>
													<li><a href="javascript:void(0);"  class="a-delet disabled">删除</a></li>
													<li><a href="javascript:void(0);" onclick="user.statusModify('${row.id}','6','${row.status}');" class="a-delet">恢复</a></li>
													<li><a href="javascript:void(0);"  class="a-delet disabled">停用</a></li>														
												</ul>
										    </div>
										    
									   </c:when> 
									   <c:otherwise> 
									    	
									   												
												<a href="javascript:viod(0);"  class="a-delet disabled">修改</a>
												<a href="javascript:viod(0);" onclick="detailShow('user/getUserDetail', '','${row.id}');" class="a-detial">详情</a>	
													
												<div class="nav_op"><a href="javascript:void(0);">更多</a>
													<ul>
													    <li><a href="javascript:void(0);" onclick="user.userSign(1,'${row.id}');" class="a-delet">签名</a></li>
														<li><a href="javascript:viod(0);"  class="a-delet disabled">删除</a></li>
														<li><a href="javascript:viod(0);" class="a-delet disabled">恢复</a></li>
														<li><a href="javascript:viod(0);"  class="a-delet disabled">停用</a></li>														
													</ul>
											   </div>
										</c:otherwise>
									 </c:choose> 
								  </c:if>	
								   <c:if test="${row.id eq userModel.userId  }">
								      <a href="javascript:void(0);" onclick="user.userSign(1,'${row.id}');" class="a-modefiy">签名</a>
									  <a href="javascript:viod(0);" onclick="detailShow('user/getUserDetail', '','${row.id}');" class="a-detial">详情</a>	
								   </c:if>							
								</td>
							</tr>
					   </c:forEach>
					   </c:if>
						
						
		
					</tbody>
				</table>
			</div>
		</div>
</div>
				
<c:if test="${result.code eq 'SUCCESS' }">
  
  <script type="text/javascript">

    Page.navigation('page', 'user/view', 'user:page', '${result.data.pageSize}', '${result.data.total}', '${result.data.pageCount}', '${result.data.currPage}', 'menuUrl');

  </script>
  
  <div id="page" class="page"> </div>

</c:if>

<div class="clearfix"></div>